import request from '@/utils/request'

export function add(data) {
  return request({
    url: '/api/askForLeave/addOrSave',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: '/api/askForLeave/remove',
    method: 'post',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: '/api/askForLeave/addOrSave',
    method: 'post',
    data
  })
}
// 主管审核
export function supervisorPass(data) {
  const obj = {
    url: '/api/askForLeave/supervisorPass',
    method: 'post',
    data
  }
  return request(obj)
}
// 经理审核
export function managerPass(data) {
  const obj = {
    url: '/api/askForLeave/managerPass',
    method: 'post',
    data
  }
  return request(obj)
}
// 人事审核
export function hrPass(data) {
  const obj = {
    url: '/api/askForLeave/hrPass',
    method: 'post',
    data
  }
  return request(obj)
}
// 反审
export function reject(data) {
  const obj = {
    url: '/api/askForLeave/reject',
    method: 'post',
    data
  }
  return request(obj)
}


export default { add, edit, del, supervisorPass,managerPass,hrPass,reject }
